/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __8B555A70_97F4_4703_8FEE_A10549669967__
#define __8B555A70_97F4_4703_8FEE_A10549669967__

#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos_box
{
    // 
    // engine_impl
    // 
    class engine_impl : public xos_stl::mem_item< xos::release_impl< engine_impl >, thread_lock >,
        public i_engine
    {
    public:
        typedef xos::release_impl< engine_impl > T;

    public:
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //

        static int get_xos_item_data( ITEM_DATA *& item_ptr );
        static int static_user_init();
        static int static_user_term();

    public:
        engine_impl();
        ~engine_impl();

    public:
        // 
        // 创建通知接口
        // 
        int create_notify( i_notify ** ppv );

        // 
        // 必要参数
        // 
        int set_fast_num( int nNum );
        int set_slow_num( int nNum );

        // 
        // 得到线程
        // 
        i_threads * fast_threads();
        i_threads * slow_threads();

    protected:
        i_threads * m_pFast;
        i_threads * m_pSlow;

    private:
        int init_data();

    public:
        int init();
        int term();

    };
} // xos

#endif // __8B555A70_97F4_4703_8FEE_A10549669967__
